gskglcompiler.c: Force GLSL version 300 es as needed
authorChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 23 Nov 2021 10:22:55 +0000 (18:22 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 3 Dec 2021 02:39:59 +0000 (10:39 +0800)
commit652ab1ac7268d75aaa0b5477e4ccb6aa8304facb
tree13384545df52bcf943332e90c8847bad50e15b01
parentbdf879427cdf83e55c0645bb480fa342b0b2603f
gskglcompiler.c: Force GLSL version 300 es as needed

For libANGLE to work with our shaders, we must use "300 es" for
the #version directive in our shaders, as well as using the non-legacy/
non-GLES codepath in the shaders.  In order to check whether we are
using the GLSL 300 es shaders, we check whether we are using a GLES 3.0+
context.  As a result, make ->glsl_version a const char* and make sure
the existing shader version macros are defined apprpriately, and add a
new macro for the "300 es" shader version string.

This will allow the gtk4 programs to run under Windows using EGL via
libANGLE.  Some of the GL demos won't work for now, but at least this
makes things a lot better for using GL-accelerated graphics under Windows
for those that want to or need to use libANGLE (such as those with
graphics drivers that aren't capable of our Desktop (W)GL requirements in
GTK.
gsk/gl/gskglcompiler.c